import request from '@/utils/request'

// 存为草稿
export function saveAsDraft(data) {
  return request({
    url: '/email/write/draft',
    method: 'post',
    data: data
  })
}

// send发送
export function insertEmailWrite(data) {
  return request({
    url: '/email/write/send',
    method: 'post',
    data: data
  })
}

// 查询写信列表
export function listWrite(query) {
  return request({
    url: '/email/write/list',
    method: 'get',
    params: query
  })
}

// 查询写信详细
export function getWrite(id) {
  return request({
    url: '/email/write/' + id,
    method: 'get'
  })
}

// 新增写信
export function addWrite(data) {
  return request({
    url: '/email/write',
    method: 'post',
    data: data
  })
}

// 修改写信
export function updateWrite(data) {
  return request({
    url: '/email/write',
    method: 'put',
    data: data
  })
}

// 删除写信
export function delWrite(id) {
  return request({
    url: '/email/write/' + id,
    method: 'delete'
  })
}
